package com.lu.library.widget

import android.Manifest
import android.app.Activity
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Color
import android.net.Uri
import android.os.Bundle
import android.os.Environment
import android.provider.MediaStore
import android.view.Gravity
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityCompat.startActivityForResult
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import com.aigestudio.wheelpicker.widgets.WheelDatePicker
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.lu.library.R
import com.lu.library.databinding.DialogChoosePicBinding
import com.lu.library.databinding.DialogWheelBinding
import com.lu.library.databinding.DialogWheelDateBinding
import com.lu.library.ext.sp
import me.shouheng.utils.ktx.onDebouncedClick
import org.joda.time.DateTime
import java.io.File
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Date

/**
 * 图片选择弹框
 */
class ChoosePicDialog(val activity: Activity,
                      val onChoosePic:()->Unit,val onTakePhone:()->Unit): BottomSheetDialog(activity) {


    private lateinit var binding: DialogChoosePicBinding


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = DialogChoosePicBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.tvCancel.setOnClickListener {
            dismiss()
        }

        binding.tvOk.setOnClickListener {
            dismiss()
        }

        binding.tvChoosePic.onDebouncedClick {
            onChoosePic()
        }
        binding.tvTakePhone.onDebouncedClick {
            onTakePhone()
        }

    }



}